package com.financial.service.heemoney.convertor;

import com.financial.service.heemoney.dto.HeemoneyConfigDTO;
import com.financial.service.heemoney.dto.businsess.HeemoneySettleBusinessDTO;
import com.financial.service.heemoney.dto.commmon.HeemoneySettleCommonDTO;
import com.financial.service.heemoney.dto.businsess.HeemoneyRefundBusinessDTO;
import com.financial.service.heemoney.dto.inparameter.HeemoneySettleInParamDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * @Author: zhaopengjun
 * @Email dashuaizhao@aliyun.com
 * @Date: 2019/12/6 10:19
 * @Des 汇收银分账公共参数自动转javabean工具类
 */
@Mapper(componentModel = "spring")
public interface HeemoneySettleConvert {
    HeemoneySettleConvert MAPPER = Mappers.getMapper(HeemoneySettleConvert.class);

    @Mapping(target = "method", source = "heemoneyConfigDTO.heemoneySettle.method")
    @Mapping(target = "key",source ="heemoneyConfigDTO.heemoneyPaymentType.key")
    HeemoneySettleCommonDTO configDTOConvertCommonDTO(HeemoneyConfigDTO heemoneyConfigDTO, HeemoneySettleInParamDTO heemoneySettleInParamDTO);

    @Mapping(target = "pshard_notify_url",source ="heemoneyConfigDTO.heemoneySettle.notify_url")
    HeemoneySettleBusinessDTO configDTOCovertBusinessDTO(HeemoneyConfigDTO heemoneyConfigDTO, HeemoneySettleInParamDTO heemoneySettleInParamDTO);
}
